Component({
  data: {
    selected: 0,
    list: [
      {
        pagePath: "/pages/index/index",
        text: "首页",
        iconType: "home",
        iconPath: "assets/images/home.png"
      },
      {
        pagePath: "/pages/supply/supply",
        text: "供需",
        iconType: "supply"
      },
      {
        pagePath: "/pages/member/member",
        text: "会员",
        iconType: "supply"
      },
      {
        pagePath: "/pages/mine/mine",
        text: "我的",
        iconType: "mine"
      }
    ]
  },
  methods: {
    switchTab(e) {
      const data = e.currentTarget.dataset
      const url = data.path
      wx.switchTab({
        url
      })
      this.setData({
        selected: data.index
      })
    }
  }
}) 